package net.vinote.smart.platform.module.database;

import java.sql.SQLException;

/**
 * 对表进行增删改查的父类
 */
public class TableModel {
	protected String tableName;

	public void delete(DBTransaction tx, String[] key, String[] val)
			throws SQLException {
		DBManager bm = DBManagerFactory.getInstance(tableName);
		if (tx != null)
			tx.join(bm);
		bm.delete(key, val);
	}

	public void deleteWhereSql(DBTransaction tx, String whereSql)
			throws SQLException {
		DBManager bm = DBManagerFactory.getInstance(tableName);
		if (tx != null)
			tx.join(bm);
		bm.deleteWhereSql(whereSql);
	}
}
